package be.lioche.soupe.kits;

import org.bukkit.GameMode;
import org.bukkit.Material;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Player;
import org.bukkit.event.Listener;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;

import be.lioche.soupe.Spawn;

public class Terroriste implements Listener{

	public Main plugin;
	public Terroriste(Main main) {
		this.plugin = main;
	}
	
	public static void lvl1(Player p){

		ItemStack casque = new ItemStack(Material.CHAINMAIL_HELMET);
		ItemStack plastron = new ItemStack(Material.CHAINMAIL_CHESTPLATE);
		ItemStack pantalon = new ItemStack(Material.CHAINMAIL_LEGGINGS);
		ItemStack bottes = new ItemStack(Material.CHAINMAIL_BOOTS);

		ItemStack epee = new ItemStack(Material.STONE_SWORD);
		ItemStack oeuf = new ItemStack(Material.EGG, 10);
		ItemStack ender = new ItemStack(Material.ENDER_PEARL, 10);
		
		ItemMeta oeufmeta = oeuf.getItemMeta();
		oeufmeta.setDisplayName("§f[§cGrenada§f]");
		oeuf.setItemMeta(oeufmeta);
		
		ItemMeta epeemeta = epee.getItemMeta();
		epeemeta.setDisplayName("§f[§cTerro'Sword§f]");
		epee.setItemMeta(epeemeta);
		
		p.getInventory().clear();
		
		p.getInventory().setHelmet(casque);
		p.getInventory().setLeggings(pantalon);
		p.getInventory().setChestplate(plastron);
		p.getInventory().setBoots(bottes);

		p.getInventory().addItem(epee);
		p.getInventory().addItem(oeuf);
		p.getInventory().addItem(ender);
		Spawn.givesoupe(p);
		
		p.sendMessage("");
		p.sendMessage(Main.name + "Kit: §cTerroriste§f | Lvl: §c1§f");
		p.sendMessage("");

		p.setGameMode(GameMode.ADVENTURE);
		p.setHealth(20.0);
		p.setWalkSpeed((float) 0.20);
	}

	public static void lvl2(Player p){

		ItemStack casque = new ItemStack(Material.CHAINMAIL_HELMET);
		ItemStack plastron = new ItemStack(Material.CHAINMAIL_CHESTPLATE);
		ItemStack pantalon = new ItemStack(Material.CHAINMAIL_LEGGINGS);
		ItemStack bottes = new ItemStack(Material.CHAINMAIL_BOOTS);

		ItemStack epee = new ItemStack(Material.IRON_SWORD);
		ItemStack oeuf = new ItemStack(Material.EGG, 15);
		ItemStack ender = new ItemStack(Material.ENDER_PEARL, 15);
		
		ItemMeta oeufmeta = oeuf.getItemMeta();
		oeufmeta.setDisplayName("§f[§cGrenada§f]");
		oeuf.setItemMeta(oeufmeta);
		
		ItemMeta epeemeta = epee.getItemMeta();
		epeemeta.setDisplayName("§f[§cTerro'Sword§f]");
		epee.setItemMeta(epeemeta);
		
		casque.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 1);
		plastron.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 1);
		pantalon.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 1);
		bottes.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 1);
		
		p.getInventory().clear();
		
		p.getInventory().setHelmet(casque);
		p.getInventory().setLeggings(pantalon);
		p.getInventory().setChestplate(plastron);
		p.getInventory().setBoots(bottes);

		p.getInventory().addItem(epee);
		p.getInventory().addItem(oeuf);
		p.getInventory().addItem(ender);
		Spawn.givesoupe(p);
		
		p.sendMessage("");
		p.sendMessage(Main.name + "Kit: §cTerroriste§f | Lvl: §c2§f");
		p.sendMessage("");

		p.setGameMode(GameMode.ADVENTURE);
		p.setHealth(20.0);
		p.setWalkSpeed((float) 0.25);
	}
	
	public static void lvl3(Player p){

		ItemStack casque = new ItemStack(Material.CHAINMAIL_HELMET);
		ItemStack plastron = new ItemStack(Material.CHAINMAIL_CHESTPLATE);
		ItemStack pantalon = new ItemStack(Material.CHAINMAIL_LEGGINGS);
		ItemStack bottes = new ItemStack(Material.CHAINMAIL_BOOTS);

		ItemStack epee = new ItemStack(Material.IRON_SWORD);
		
		ItemStack ender = new ItemStack(Material.ENDER_PEARL, 20);
		ItemStack oeuf = new ItemStack(Material.EGG, 20);
		ItemMeta oeufmeta = oeuf.getItemMeta();
		oeufmeta.setDisplayName("§f[§cGrenada§f]");
		oeuf.setItemMeta(oeufmeta);
		
		ItemMeta epeemeta = epee.getItemMeta();
		epeemeta.setDisplayName("§f[§cTerro'Sword§f]");
		epee.setItemMeta(epeemeta);
		
		casque.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 2);
		plastron.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 2);
		pantalon.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 2);
		bottes.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 2);
		
		epee.addEnchantment(Enchantment.FIRE_ASPECT, 1);
		
		
		p.getInventory().clear();
		
		p.getInventory().setHelmet(casque);
		p.getInventory().setLeggings(pantalon);
		p.getInventory().setChestplate(plastron);
		p.getInventory().setBoots(bottes);

		p.getInventory().addItem(epee);
		p.getInventory().addItem(oeuf);
		p.getInventory().addItem(ender);
		Spawn.givesoupe(p);
		
		p.sendMessage("");
		p.sendMessage(Main.name + "Kit: §cTerroriste§f | Lvl: §c3§f");
		p.sendMessage("");

		p.setGameMode(GameMode.ADVENTURE);
		p.setHealth(20.0);
		p.setWalkSpeed((float) 0.30);
	}

}
